<%@page import="vo.Person"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>网上订餐系统——我的购物车</title>
        <link type="text/css" href="css/public.css" rel="stylesheet"/>
        <style>
            #body h2{
                width: 100%;
                text-align: center;
                border-bottom: 1px dashed gainsboro;
                padding-top: 15px;
                padding-bottom: 15px;
            }
            #body .table{
                width: 80%;
                margin: 0 auto;
                text-align: center;
                margin-top: 30px;
            }
            #body .table .td{
                font-weight: bolder;
                width: 133px;
                height: 60px;
                line-height: 60px;
            }
            #body .table .td1{
                font-size: 15px;
            }
            #body .table .td1 a{
                text-decoration: none;
                color: #104E8B;
            }

            #body .span{
                width: 20%;
                float: left;
                margin: 0 auto;
                text-align: center;
                margin-top: 50px;
                font-weight: bolder;
                margin-bottom: 20px;
            }
            #body #span{
                margin-left: 370px;
            }

            #body .button{
                width: 20%;
                margin: 0 auto;
                margin-bottom: 150px;
            }
            #body .button input[type="submit"]{
                width: 200px;
                height: 40px;
                border: none;
                background-color: ;
                font-size: 20px;
            }
        </style>
         <!-- CSS here -->
        <link rel="stylesheet" href="css/bootstrap.min.css">
        <link rel="stylesheet" href="css/owl.carousel.min.css">
        <link rel="stylesheet" href="css/animate.min.css">
        <link rel="stylesheet" href="css/nice-select.css">
        <link rel="stylesheet" href="css/themify-icons.css">
        <link rel="stylesheet" href="css/magnific-popup.css">
        <link rel="stylesheet" href="css/meanmenu.css">
		<link rel="stylesheet" href="css/fontawesome-all.min.css">
		<link rel="stylesheet" href="css/slick.css">
		<link rel="stylesheet" href="css/default.css">
		<link rel="stylesheet" href="css/style.css">
		<link rel="stylesheet" href="css/responsive.css">
    </head>
    <body>
    	<jsp:useBean id="user" class="vo.Person" scope="session"></jsp:useBean>    	
    	<jsp:useBean id="ordersBean" class="vo.Orders" scope="page"></jsp:useBean>
    	<jsp:setProperty property="user" name="ordersBean" value="${user}"/>
		<%
		if(user.getUser_name()==null){
			response.getWriter().println("<script LANGUAGE='javascript'> alert('请先登录！');</script>");
			response.sendRedirect("register.jsp");
		}
		%>
       	<!-- header-start -->
		<header>
			<div id="sticky-header" class="header-top-area header-2 pr-60 pl-60">
				<div class="container-fluid">
					<div class="row">
						<div class="col-xl-3 col-lg-2">
							<div class="logo">
			                    <c:choose>
				                	<c:when test="${user.user_name!=null}">
				                		<a href="UserExitServlet"><span>【退出】</span></a>
				                		<span>欢迎您：<c:out value="${user.user_name}"></c:out></span>
				                	</c:when>
				                	<c:otherwise>
				                		<a href="register.jsp"><span>【注册】</span></a>
				                    	<a href="register.jsp"><span>【登录】</span></a>
				                	</c:otherwise>
			                	</c:choose>
							</div>
						</div>
						<div class="col-xl-6 col-lg-8">
							<div class="main-menu text-center">
								<nav id="mobile-menu">
									<ul>
										<li><a href="index.jsp">首页</a></li>
										<li><a href="about.jsp">关于我们</a></li>
										<li  class="active"><a href="shopping.jsp">我的购物车</a></li>
										<li><a href="order_search.jsp">订单查询</a></li>
										<li><a href="MemberServlet">会员管理中心</a></li>
									</ul>
								</nav>
							</div>
							<div class="mobile-menu"></div>
						</div>
						<div class="col-xl-3 col-lg-2">
							<div class="header-right f-right d-none d-md-none d-lg-block">
                               <ul>
                                   <li><a href="#" data-toggle="modal" data-target="#search-modal"><span class="ti-search"></span></a>
                                    </li>
                                   <li><a href="shopping-cart.html"><span class="ti-shopping-cart"></span></a></li>
                                   <li class="info-bar"><a href="#"><span class="ti-align-right"></span></a></li>
                               </ul>
                           </div>
						</div>

					</div>
				</div>
			</div>
		</header>
		<!-- header-end -->

        <div id="body">
            <h2>您的购物车列表信息：</h2>
            <table class="table">
                <tr class="tr">
                    <td class="td"><span class="text">编号</span></td>
                    <td class="td"><span class="text">菜名</span></td>
                    <td class="td"><span class="text">数量</span></td>
                    <td class="td"><span class="text">单价</span></td>
                    <td class="td"><span class="text">总价</span></td>
                    <td class="td"><span class="text">备注</span></td>
                    <td class="td"><span class="text">操作</span></td>
                </tr>
                <jsp:getProperty property="showBuyList" name="ordersBean"/>
            </table>
            <div class="span" id="span"><span class="num">总数量：</span><span><jsp:getProperty property="total" name="ordersBean"/></span></div>
            <div class="span"><span>总价：</span><span class="pri"><jsp:getProperty property="totalPrice" name="ordersBean"/></span></div>
            <div class="button">
            	<form action="OrdersPayServlet" method="post">
	            	<input type="submit" value="结算"/>
            	</form>
            </div>
        </div>
          <!-- brand-area-start -->
		<div class="brand-area yellow-bg pt-75 pb-75">
			<div class="container">
				<div class="row justify-content-between">
					<div class="brand-active owl-carousel">
						<div class="col-xl-12">
							<div class="brand-wrapper">
								<div class="brand-img">
									<img src="img/brand/1.png" alt="" />
								</div>
							</div>
						</div>
						<div class="col-xl-12">
							<div class="brand-wrapper">
								<div class="brand-img">
									<img src="img/brand/2.png" alt="" />
								</div>
							</div>
						</div>
						<div class="col-xl-12">
							<div class="brand-wrapper">
								<div class="brand-img">
									<img src="img/brand/3.png" alt="" />
								</div>
							</div>
						</div>
						<div class="col-xl-12">
							<div class="brand-wrapper">
								<div class="brand-img">
									<img src="img/brand/4.png" alt="" />
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- brand-area-end -->
		
        <!-- JS here -->
        <script src="js/vendor/modernizr-3.5.0.min.js"></script>
        <script src="js/vendor/jquery-1.12.4.min.js"></script>
        <script src="js/waypoints.min.js"></script>
        <script src="js/jquery.counterup.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/owl.carousel.min.js"></script>
        <script src="js/isotope.pkgd.min.js"></script>
        <script src="js/jquery.nice-select.min.js"></script>
        <script src="js/jquery.meanmenu.min.js"></script>
        <script src="js/slick.min.js"></script>
        <script src="js/ajax-form.js"></script>
        <script src="js/wow.min.js"></script>
        <script src="js/jquery.scrollUp.min.js"></script>
        <script src="js/imagesloaded.pkgd.min.js"></script>
        <script src="js/jquery.magnific-popup.min.js"></script>
        <script src="js/plugins.js"></script>
        <script src="js/main.js"></script>
       
    </body>
</html>